package com.team2.outpatient_sys.service.impl;

import com.team2.outpatient_sys.dao.DepartmentDao;
import com.team2.outpatient_sys.dao.DoctorDao;
import com.team2.outpatient_sys.pojo.DepartmentAndDoctors;
import com.team2.outpatient_sys.pojo.Doctor;
import com.team2.outpatient_sys.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentDao departmentDao;
    @Autowired
    private DoctorDao doctorDao;

    /**
     * 获取某一id的指定科室信息和科室下所有医生信息的集合的服务的实现
     * @param deptId 指定科室的id
     * @return 查询的科室信息连带科室下所有医生信息的集合的封装对象
     */
    @Override
    public DepartmentAndDoctors getDeptAndDoctors(Integer deptId) {
        return departmentDao.queryDeptAndDoctors(deptId);
    }

    /**
     * 获取某一id的指定科室下所有医生信息的集合的服务的实现
     * @param deptId 指定科室的id
     * @return 获取到的指定科室下所有医生信息的集合
     */
    @Override
    public List<Doctor> getDoctors(Integer deptId) {
        return doctorDao.queryByDeptId(deptId);
    }
}
